package strain

const testVersion = 1

type Ints []int
type Lists [][]int
type Strings []string

func (this Ints) Keep(call func(int) bool) Ints {
	if this == nil {
		return nil
	}

	var intsKeep Ints
	for i := 0; i < len(this); i++ {
		if call(this[i]) {
			intsKeep = append(intsKeep, this[i])
		}
	}

	return intsKeep
}
func (this Ints) Discard(call func(int) bool) Ints {
	if this == nil {
		return nil
	}

	var intsKeep Ints
	for i := 0; i < len(this); i++ {
		if !call(this[i]) {
			intsKeep = append(intsKeep, this[i])
		}
	}

	return intsKeep
}
func (this Lists) Keep(call func([]int) bool) Lists {
	var listsKeep Lists
	for i := 0; i < len(this); i++ {
		if call(this[i]) {
			listsKeep = append(listsKeep, this[i])
		}
	}

	return listsKeep
}
func (this Strings) Keep(call func(string) bool) Strings {
	var listsKeep Strings
	for i := 0; i < len(this); i++ {
		if call(this[i]) {
			listsKeep = append(listsKeep, this[i])
		}
	}

	return listsKeep
}
